package com.xiaofei.controller;

import com.xiaofei.Tools.Result;
import com.xiaofei.pojo.emp;
import com.xiaofei.pojo.empLogin;
import com.xiaofei.service.insterface.EmpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class LoginController{
    @Autowired
    private EmpService empService;
    @PostMapping("/login")
    public Result login(@RequestBody emp e){
        empLogin emplogin = empService.login(e);
        if (emplogin == null)
            return Result.error("用户名或密码错误");
        return Result.success(emplogin);
    }
}
